<?php
class cityApi extends core
{
	public function getcitybypidAction($arg)
	{
		$query	= !empty($arg['pid']) ? "ProvinceID={$arg['pid']}" : null;

		$city	= base::init('city')->fetchAll($query);
		$print	= '<select name="city" class="">
        <option value="">请选择</option>';
		foreach ($city as $val)
		{
			$select = $arg['city'] == $val['CityName'] ? ' selected=selected': '';
			$print	.= '<option value="'.$val['CityName'].'"'.$select.'>'.$val['CityName'].'</option>';
		}
    	$print	.= '</select>';
    	die($print);
	}
}
